
var common=require("../../utils/parts.js");
var globalGiftIndex = null;        //打开的是哪个级别的礼盒
var globalStarIndex=5;          //批量卖出车件时，定义全局的选中的那种车件星级
var resourceUrl = getApp().request("imgUrl");
var requestUrl = getApp().request("url");
var header=getApp().request("header");
var app = getApp().globalData;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    btnList:["全部","车件","礼盒","套装"],
    current: 0,
    batchSell:{
      starData:[
        {
          starFront: false,
          starTxt: "一星配件",
          starPartNum:0,
          starPartPrice:0
        },
        {
          starFront: false,
          starTxt: "二星配件",
          starPartNum: 0,
          starPartPrice: 0
        },
        {
          starFront: false,
          starTxt: "三星配件",
          starPartNum: 0,
          starPartPrice: 0
        },
        {
          starFront: false,
          starTxt: "四星配件",
          starPartNum: 0,
          starPartPrice: 0
        },
        {
          starFront: false,
          starTxt: "五星配件",
          starPartNum: 0,
          starPartPrice: 0
        }
      ],
      allPartNum:0,
      allPartPrice:0,
    },
    giftInforBox: false,
    giftOpenBox: true,
    carInforBox: false,
    //carPartInforBox: false,
    sellCarPartBox: false,
    batchSellBox: false,
    content:"",    
    carPartInforBox:{    //点击车件弹出框
      isShow:false,
      isHaveCar:""
    },
    giftBoxInforBox: {   //点击礼盒弹出框
      isShow: false
    },
    openGiftBox:{        //打开礼盒的车件
      isShow:false
    },
    depotFullBox:{    //仓库容量不足弹框
      isShow: false
    },
    car:true,
    resourceUrl: resourceUrl,
    suitInfo:"",        //套装信息
    isJdticket:false,     //是否显示京东券
    prizeCoin:[         //60000或者120000金币
      { coin: false },
      { coin: false }
    ],
    jdTicket:"",           //京东券码
    jdTicketSort:""        //那种京东券10  20  50 
  },
  
  
  
  
 
  
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log("load")
    if (options.id=="gift"){
      this.setData({
        current: 2
      })
    }else{
      if (options.id == "suit") {
        this.setData({
          current: 3
        })
      }
    }  
    wx.showLoading({
      title: '',
      mask: true
    })
  },
  
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    wx.hideLoading()
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
    // var newSuitArr=[
    //   { "id": 2, "star": 2, "color": 2, "prize_type_id": 2, "receive_at": 0, "jd_coupon": "60000" },
    //   { "id": 3, "star": 3, "color": 3, "prize_type_id": 3, "receive_at": 123213213, "jd_coupon": "21093UDHFUI9302" },
    //   { "id": 4, "star": 4, "color": 4, "prize_type_id": 4, "receive_at":0, "jd_coupon": "" }
    // ];
    
    wx.showShareMenu({
      withShareTicket: true
    });
    var that = this;
    //获取车件信息
    that.getDepotCart();

    //获取仓库礼盒信息
    var giftInforData = [];
    giftInforData.push({ giftBoxName: "初级礼盒", giftNum: app.juniorGiftBoxN, index: 1, giftTypeName: "juniorGiftBoxN" });
    giftInforData.push({ giftBoxName: "中级礼盒", giftNum: app.middleGiftBoxN, index: 2, giftTypeName: "middleGiftBoxN" });
    giftInforData.push({ giftBoxName: "高级礼盒", giftNum: app.seniorGiftBoxN, index: 3, giftTypeName: "seniorGiftBoxN" });
    //console.log(giftInforData)
    that.setData({
      "content.giftBox": giftInforData
    })
    //是否有车，如果没有车，隐藏立即安装车件按钮
    var fightCarTypeId = app.fightCarTypeId;
    var isHaveCar = fightCarTypeId == 0 ? false : true;
    that.setData({
      "carPartInforBox.isHaveCar": isHaveCar,
      "carPartInforBox.isShow":false
    });
    this.loadSuit()
  },
  //初次加载套装详情
  loadSuit(){
    var that=this;
    var starArr = ["一", "两", "三", "四", "五"];
    //定义空额套装
    var suitArr = [
      { "id": 1, "star": 1, "color": 1, "prize_type_id": 1, "receive_at": "no", "jd_coupon": "xxx" },
      { "id": 2, "star": 2, "color": 2, "prize_type_id": 2, "receive_at": "no", "jd_coupon": "xxx" },
      { "id": 3, "star": 3, "color": 3, "prize_type_id": 3, "receive_at": "no", "jd_coupon": "xxx" },
      { "id": 4, "star": 4, "color": 4, "prize_type_id": 4, "receive_at": "no", "jd_coupon": "xxx" },
      { "id": 5, "star": 5, "color": 5, "prize_type_id": 5, "receive_at": "no", "jd_coupon": "xxx" }
    ];
    //请求后端查看套装领取情况
    wx.request({
      url: requestUrl + 'findSuitInfo',
      method: "POST",
      data: { userId: app.session_key.userId, salt: app.session_key.salt },
      header: header,
      success: (res) => {
        if (res.statusCode != 200) {
          getApp().showModal("服务器异常");
          return
        }
        wx.hideLoading();
        if (res.data.code == 200) {
          console.log(res);
          var newSuitArr =res.data.data;
          for (var i = 0; i < newSuitArr.length; i++) {
            suitArr[newSuitArr[i].prize_type_id - 1] = newSuitArr[i];
          }
          console.log(suitArr);
          for (var i = 0; i < suitArr.length; i++) {
            suitArr[i].starTxt = starArr[suitArr[i].star - 1];
            suitArr[i].colorTxt = common.color[suitArr[i].color - 1];
            if (i < 2) {
              if (suitArr[i].receive_at == "no") {
                suitArr[i].btnTxt = "未获得";
              } else if (suitArr[i].receive_at == 0) {
                suitArr[i].btnTxt = "领取奖励";
              } else {
                suitArr[i].btnTxt = "已领取";
              }
            } else {
              console.log(suitArr[i].receive_at == "")
              if (suitArr[i].receive_at == "no") {
                suitArr[i].btnTxt = "未获得";
              } else if (suitArr[i].receive_at == 0) {
                suitArr[i].btnTxt = "领取奖励";
              } else {
                suitArr[i].btnTxt = "查看";
              }
            }
          }
          that.setData({
            suitInfo: suitArr
          })
        } else if (res.data.code == 401 || res.data.code == 301 || res.data.code == 302) {
          getApp().showModal("提交信息有误" + res.data.code);
        } else if (res.data.code == 303) {
          for (var i = 0; i < suitArr.length; i++) {
            suitArr[i].starTxt = starArr[suitArr[i].star - 1];
            suitArr[i].colorTxt = common.color[suitArr[i].color - 1];
            suitArr[i].btnTxt = "未获得";
          }
          that.setData({
            suitInfo: suitArr
          })
        } else if (res.data.code == 800) {
          getApp().showModal(res.data.data.msg);
        }

      },
      fail: function (res) {
        console.log("加载套装failed");
        console.log(res);
        wx.hideLoading();
        getApp().showModal("网络超时，请检查您的网络");
      }
    });
  },
  //领取奖励
  btnGetPrize(e){
    var that=this;
    var status = e.target.dataset.status;
    var prizeTypeId = e.target.dataset.prizetypeid;    //奖品类型prizeTypeId  1,2,3,4,5
    var id = e.target.dataset.id;             //奖品数量编号id 
    var suitArr1 = this.data.suitInfo;
    console.log(prizeTypeId + "----" + status)
    //未获得情况不能点击
    if ((prizeTypeId < 3 && status != 0) || (prizeTypeId >= 3 && status == "no")) {
      return false
    }
    //京东券查看
    if (prizeTypeId >= 3 &&status > 0) {
      var jdjdTicket2 = suitArr1[prizeTypeId - 1].jd_coupon;
      this.setData({
        isJdticket: true,
        jdTicket: jdjdTicket2,
        jdTicketSort: prizeTypeId
      });
      return false;
    } 
    wx.showLoading({
      mask:true
    })
    //请求获取奖励
    wx.request({
      url: requestUrl + 'receiveSuitReward',
      method: "POST",
      data: { userId: app.session_key.userId, salt: app.session_key.salt, id: id},
      header: header,
      success: (res) => {
        if (res.statusCode != 200) {
          getApp().showModal("服务器异常");
          return
        }
        wx.hideLoading();
        if (res.data.code == 200) {
          console.log(res);
          if (prizeTypeId < 3) {
            //金币处理
            if (status == 0) {
              suitArr1[prizeTypeId - 1].receive_at = new Date().getTime();
              suitArr1[prizeTypeId - 1].btnTxt = "已领取";
              this.setData({
                suitInfo: suitArr1,
                ["prizeCoin[" + (prizeTypeId - 1) + "].coin"]: true
              });
              //2s之后隐藏金币显示
              setTimeout(function(){
                that.setData({
                  ["prizeCoin[" + (prizeTypeId - 1) + "].coin"]: false
                });
              },2000)
              //全局加金币
              app.gold += res.data.data.gold;
            } else {
              return false;
            }
          } else {
            if (status == 0) {
              //领取京东券
              var jdTicket = res.data.data.jd_coupon;
              suitArr1[prizeTypeId - 1].jd_coupon = jdTicket;
              suitArr1[prizeTypeId - 1].receive_at = new Date().getTime();
              suitArr1[prizeTypeId - 1].btnTxt = "查看";
              this.setData({
                suitInfo: suitArr1,
                isJdticket: true,
                jdTicket: jdTicket,
                jdTicketSort: prizeTypeId
              })
            }else {
              return false;
            }
          }
        } else if (res.data.code == 201) {
          var jdjdTicket2 = suitArr1[prizeTypeId - 1].jd_coupon;
          this.setData({
            isJdticket: true,
            jdTicket: jdjdTicket2,
            jdTicketSort: prizeTypeId
          });
        } else if (res.data.code == 202) {
          getApp().showModal("今日奖品已经领取完了，明天12点再来试试运气哦！");
        }else if (res.data.code == 401 || res.data.code == 301 || res.data.code == 302) {
          getApp().showModal("提交信息有误" + res.data.code);
        } else if (res.data.code == 303) {
          getApp().showModal("id错误");
        } else if (res.data.code == 800) {
          getApp().showModal(res.data.data.msg);
        }

      },
      fail: function (res) {
        console.log("领取套装接口failed");
        console.log(res);
        wx.hideLoading();
        getApp().showModal("网络超时，请检查您的网络");
      }
    });

    
  },
  //套装页查看活动规则
  btn_ckhdgz(){
    wx.navigateTo({
      url: '../noticeDetail/noticeDetail?id=second',
    })
  },
  //关闭京东券页面
  btn_closeJdBg(){
    this.setData({
      isJdticket: false
    })
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    //是否选车
    var fightCarTypeId = app.fightCarTypeId;
    //随机一句宣言
    var declaration = getApp().Refit();
    var myRefitTxt = Math.floor(Math.random() * declaration.length);
    
    if (fightCarTypeId == 0) {
      return {
        title: getApp().shareTitle1(),
        path: "/pages/index/index"
      }
    } else {
      return {
        title: getApp().shareTitle2(),
        path: "/pages/openShare/openShare?shareId=" + app.session_key.userId + "&carTypeId=" + fightCarTypeId + "&shareRefitNum=" + myRefitTxt + "&carName=SUV概念车",
        success: (re) => {
          if (Object.keys(re).length == 1) {
            return
          }
          var ticket = re.shareTickets[0];
          getApp().shareFn(ticket);
        }
      }
    }
  },
  switchTap:function(e){
    this.setData({
      current:e.currentTarget.dataset.current
    })
  },
  btnCloseGift:function(e){
    this.setData({
      "giftBoxInforBox.isShow": false
    });
  },
  btnCloseCar: function () {
    console.log(123213)
    this.setData({
      carInforBox: false
    })
  },
  btnCloseCarPart:function(){
    this.setData({
      "carPartInforBox.isShow": false
    });
  },
  giftShow () {
    this.setData({
      "giftInfor.giftInforBox": true
    })
  },
  btnCloseBatchSellBox(){
    this.setData({
      batchSellBox: false
    })
  },
 
  

  //获取本地存储中的车件信息
  getDepotCart: function () {
    //获取仓库车件
    var carPartInfor = app.depot;
    //配件信息
    var carDataArr = [];
    for (var val in carPartInfor) {
      var first = val[0];  //类别
      var second = val[1]; //星级
      var third = val[2];  //颜色
      var baseAttribute = common.getBaseAttribute(first, second);   //基础属性
      var colorAddition = common.getColorAddition(third);           //颜色加成
      var colorSingle = "(" + common.color[third - 1] + ")";
      if (first == "a" || first == "h"){                        //颜色加成
        colorSingle=""
      };
      //当是稀有配件时，单独处理
      var partName = null;
      var partDes=null;
      if (first=="h"){
        partName = common[first][second][third].name;
        partDes = common[first][second][third].intro
      }else{
        partName = common[first][second].name + colorSingle;
        partDes = common[first][second].intro
      }
      if (first == "h" || first == "a"){
        colorAddition=0;
      }
      var price = (baseAttribute * second + colorAddition) * 10;    //价格
      carDataArr.push({
        imgUrl: val,
        star: val[1],
        name: partName,
        des: partDes,
        price: price,
        partNum: carPartInfor[val] 
      });
    }
    this.setData({
      "content.part": carDataArr
    })
  },
  //------------------------点击车件卖出----------------------
  //车件点击弹出框
  btnPartClick(e) {
    var partIndex = e.currentTarget.dataset.part;
    this.setData({
      "carPartInforBox.isShow": true,
      "carPartInforBox.infor": this.data.content.part[partIndex]
    });
  },
  //立即安装配件
  btnNowInstall() {
    //跳转到改装页面
    wx.redirectTo({
      url: '../repack/repack',
    })
  },
  //点击卖了换钱按钮
  btnSellMoney() {
    this.setData({
      "sellCarPartBox": true
    });
  },
  //取消卖车件
  btnSellCarPartCancel: function () {
    this.setData({
      sellCarPartBox: false
    })
  },
  //确认卖车件
  btnSellCarPartEnsure: function () {
    var that = this;
    var sellPart = this.data.carPartInforBox.infor.imgUrl;
    wx.showLoading({
      title: '',
      mask: true
    })
    wx.request({
      url: requestUrl+'sellParts',
      method: "POST",
      data: { userId: app.session_key.userId, salt: app.session_key.salt, parts: sellPart },
      header: header,
      success: function (re) {
        console.log(re)
        if(re.statusCode!=200){
          getApp().showModal("服务器异常");
          return
        }
        wx.hideLoading();
        if(re.data.code==200){
            //操作data数据
            var contentPartNew = that.data.content.part;
            for (var i = 0; i < contentPartNew.length; i++) {
              if (contentPartNew[i].imgUrl == sellPart) {
                if (contentPartNew[i].partNum > 1) {
                  contentPartNew[i].partNum -= 1;
                } else {
                  contentPartNew.splice(i, 1)
                }
              }
            }
            //操作本地存储中的车件
            var carPartInforNew = app.depot;
            if (carPartInforNew[sellPart] > 1) {
              carPartInforNew[sellPart] -= 1
            } else {
              delete carPartInforNew[sellPart];
            }
            app.depot=carPartInforNew;
            //卖出车件得到金币存储本地
            var allGoldNum = app.gold;   
            allGoldNum += that.data.carPartInforBox.infor.price*0.4;  
            app.gold=allGoldNum;
            that.setData({
              "content.part": contentPartNew,
              sellCarPartBox: false,
              "carPartInforBox.isShow": false
            })
        } else if (re.data.code == 401 || re.data.code == 301 || re.data.code == 302){
          getApp().showModal("提交信息有误!")
        } else if (re.data.code == 303) {
          getApp().showModal("仓库没有此配件!")
        } else if (re.data.code == 800) {
          getApp().showModal(re.data.data.msg);
          wx.hideLoading();
        }            
      },
      fail: (fai) => {
        console.log("确认卖车件fail");
        console.log(fai)
        wx.hideLoading();
        getApp().showModal("网络超时，请检查您的网络");
      }
    })
  },
  //------------------------点击礼盒抽配件----------------------
  //礼盒点击弹出框
  btnGiftBoxClick(e) {
    if(this.data.content.part.length>=48){
      this.setData({
        "depotFullBox.isShow": true
      });
      return
    }
    var giftInforIndex = e.currentTarget.dataset.giftinfor;      //礼盒等级
    globalGiftIndex = e.currentTarget.dataset.giftinfor;
    this.setData({
      "giftBoxInforBox.isShow": true,
      "giftBoxInforBox.infor": this.data.content.giftBox[giftInforIndex]
    });

  },
  //点击打开礼盒
  btnOpenGiftBox: function () {
    var that = this;
    var giftType = that.data.giftBoxInforBox.infor.index;
    wx.showLoading({
      title: '',
      mask: true
    })
    wx.request({
      url: requestUrl +'openGiftBox',
      method: "POST",
      data: { userId: app.session_key.userId, salt: app.session_key.salt, "type": giftType },
      header: header,
      success: function (res) {
        console.log(res)
        if (res.statusCode != 200) {
          getApp().showModal("服务器异常");
          return
        }
        wx.hideLoading();
        if (res.data.code == 200) {
          var newPart = res.data.data.parts;   //打开礼盒获得的车件
          console.log(globalGiftIndex + "-------------");
          //操作data中的礼盒数据
          var giftBoxDataNew = that.data.content.giftBox;
          giftBoxDataNew[globalGiftIndex].giftNum -= 1;
          //操作本地存储的礼盒数据
          var giftTypeName = that.data.giftBoxInforBox.infor.giftTypeName;
          var giftTypeNameStorageNum = app[giftTypeName];
          giftTypeNameStorageNum--;
          app[giftTypeName] = giftTypeNameStorageNum;
          //打开的礼盒得到车件加到data总车件中
          var carPartInforNew = app.depot;
          if (carPartInforNew==""){
            carPartInforNew={};
          }
          console.log(carPartInforNew)
          if (carPartInforNew[newPart]) {
            var newPartNum = carPartInforNew[newPart];
            newPartNum++;
            carPartInforNew[newPart] = newPartNum;
          } else {
            carPartInforNew[newPart] = 1;
          };
          //处理配件颜色
          var colorOpenPart="";
          if (newPart[0] == "a" || newPart[0] == "h") {                       
            colorOpenPart = "";
          } else {
            colorOpenPart = "(" + common.color[[newPart[2]] - 1] + ")";
          };
          //当是稀有配件时，单独处理名字
          var partName2 = null;
          if (newPart[0] == "h") {
            partName2 = common[newPart[0]][newPart[1]][newPart[2]].name;
          } else {
            partName2 = common[newPart[0]][newPart[1]].name + colorOpenPart;
          }
          app.depot = carPartInforNew;
          that.getDepotCart();
          that.setData({
            "giftBoxInforBox.isShow": false,
            "openGiftBox.isShow": true,
            "openGiftBox.infor": {
              imgUrl: newPart,
              star: newPart[1],
              name: partName2
            },
            "content.giftBox": giftBoxDataNew
          })
        } else if (res.data.code == 401 || res.data.code == 301 || res.data.code == 302 || res.data.code == 402){
          getApp().showModal("提交信息有误!")
        } else if (res.data.code == 303) {
          getApp().showModal("该礼盒不存在!")
        } else if (res.data.code == 304) {
          getApp().showModal("仓库已满，请先卖出车件!")
        } else if (res.data.code == 800) {
          getApp().showModal(res.data.data.msg);
          wx.hideLoading();
        }
      },
      fail: (fai) => {
        console.log("打开礼盒fail");
        console.log(fai)
        wx.hideLoading();
        getApp().showModal("网络超时，请检查您的网络");
      }
    })

  },
  //打开礼盒的配件点击确定关闭弹框
  btnEnsureGitfOpen: function () {
    this.setData({
      "giftBoxInforBox.isShow": false,
      "openGiftBox.isShow": false
    })
  },
  //-----------------------------批量卖出配件----------------------------
  //点击批量卖车件
  btnBatchSell() {
    var depot = app.depot;
    console.log(depot)
    var starData = this.data.batchSell.starData;
    for (var i = 0; i < starData.length;i++){
      starData[i].starFront = false;
      starData[i].starPartNum = 0;
      starData[i].starPartPrice=0;
    }
    var starPartNum=0;
    for (var val in depot) {
      starPartNum = starData[val[1] - 1]["starPartNum"];
      starPartNum += depot[val];
      starData[val[1] - 1]["starPartNum"] = starPartNum;
      //车件价格
      var first = val[0];  //类别
      var second = val[1]; //星级
      var third = val[2];  //颜色
      var baseAttribute = common.getBaseAttribute(first, second);   //基础属性
      var colorAddition = common.getColorAddition(third);           //颜色加成
      var price = (baseAttribute * second + colorAddition) * 10;    //价格

      var starPartPrice = starData[val[1] - 1]["starPartPrice"];
      starPartPrice += price * depot[val];
      starData[val[1] - 1]["starPartPrice"] = starPartPrice;
    }
    this.setData({
      batchSellBox: true,
      "batchSell.starData": starData
    })
    console.log(depot)
  },
  //选中批量卖出配件
  batchStarBtnIsSelect: function (e) {
    var index = e.currentTarget.dataset.index;
    var allPartNumData = this.data.batchSell.starData;
    var allPartNum = this.data.batchSell.allPartNum;
    var allPartPrice = this.data.batchSell.allPartPrice;
    var changeData = "batchSell.starData[" + index + "].starFront";
    
    
    if (!allPartNumData[index].starFront) {
      for (var i = 0; i < allPartNumData.length; i++) {
        allPartNumData[i].starFront = false;
      }
      allPartNumData[index].starFront = true;
      allPartNum = allPartNumData[index].starPartNum;
      allPartPrice = allPartNumData[index].starPartPrice;
      globalStarIndex = index;
    } else {
      for (var i = 0; i < allPartNumData.length; i++) {
        allPartNumData[i].starFront = false;
      }
      allPartNum = 0;
      allPartPrice = 0;
      globalStarIndex = 5;
      console.log(2143214)
    }
    this.setData({
      "batchSell.allPartNum": allPartNum,
      "batchSell.allPartPrice": allPartPrice,
      "batchSell.starData": allPartNumData
    });
  },
  //确定批量卖出车件
  btnEnsureBatchSellPart() {
    var that = this;
    console.log(globalStarIndex)
    if (globalStarIndex == 5) {
      getApp().showModal("您还未选择配件")
      return
    }
    if (this.data.batchSell.allPartNum == 0) {
      getApp().showModal("没有配件")
      return
    }
    wx.showLoading({
      title: '',
      mask: true
    })
    //请求后台批量卖车件
    wx.request({
      url: requestUrl +'sellPartsByStar',
      method: "POST",
      data: { userId: app.session_key.userId, salt: app.session_key.salt, star: globalStarIndex + 1 },
      header: header,
      success: function (re) {
        console.log(re)
        if (re.statusCode != 200) {
          getApp().showModal("服务器异常");
          return
        }
        wx.hideLoading();
        if (re.data.code == 200) {
          //删除本地的对应车件
          var depot = app.depot;
          for (var val in depot) {
            if (val[1] == (globalStarIndex+1)) {
              delete depot[val]
            }
          }
          //卖出车件得到金币存储本地
          var allGoldNum = app.gold;
          allGoldNum += that.data.batchSell.allPartPrice * 0.4;
          app.gold=allGoldNum;
          app.depot = depot;
          //初始化批量卖配件box
          var starData = that.data.batchSell.starData;
          for (var i = 0; i < starData.length; i++) {
            starData[i].starFront = false;
            starData[i].starPartNum = 0;
            starData[i].starPartPrice = 0;
          }
          that.setData({
            batchSellBox: false,
            ["batchSell.starData"]: starData,
            "batchSell.allPartNum": 0,
            "batchSell.allPartPrice": 0
          });
          that.getDepotCart();
          
        } else if (re.data.code == 401 || re.data.code == 402 || re.data.code == 301 || re.data.code == 302){
          getApp().showModal("提交信息有误!")
        } else if (re.data.code == 303) {
          getApp().showModal("仓库中无此星级配件!")
        } else if (re.data.code == 800) {
          getApp().showModal(re.data.data.msg);
          wx.hideLoading();
        }
      },
      fail: (fai) => {
        console.log("批量卖车件fail");
        console.log(fai)
        wx.hideLoading();
        getApp().showModal("网络超时，请检查您的网络");
      }
    })
  },
  //-------------------------------------做任务抽配件-------------------------
  btnDoTask() {
    wx.navigateTo({
      url: '../dayTask/dayTask',
    })
  },
  btnDepotFullBoxIKnow(){
    this.setData({
      "depotFullBox.isShow": false
    });
  }
})